package com.ruoyi.report.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.report.mapper.CommunityNoticeMapper;
import com.ruoyi.report.domain.CommunityNotice;
import com.ruoyi.report.service.ICommunityNoticeService;

import static com.ruoyi.common.utils.DateUtils.YYYY_MM_DD_HH_MM_SS;

/**
 * 档案Service业务层处理
 * 
 * @author mac
 * @date 2023-02-11
 */
@Service
public class CommunityNoticeServiceImpl implements ICommunityNoticeService 
{
    @Autowired
    private CommunityNoticeMapper communityNoticeMapper;

    /**
     * 查询档案
     * 
     * @param id 档案主键
     * @return 档案
     */
    @Override
    public CommunityNotice selectCommunityNoticeById(Long id)
    {
        return communityNoticeMapper.selectCommunityNoticeById(id);
    }

    /**
     * 查询档案列表
     * 
     * @param communityNotice 档案
     * @return 档案
     */
    @Override
    public List<CommunityNotice> selectCommunityNoticeList(CommunityNotice communityNotice)
    {
        return communityNoticeMapper.selectCommunityNoticeList(communityNotice);
    }

    /**
     * 新增档案
     * 
     * @param communityNotice 档案
     * @return 结果
     */
    @Override
    public int insertCommunityNotice(CommunityNotice communityNotice)
    {
        communityNotice.setReleaseTime(DateUtils.dateTimeNow(YYYY_MM_DD_HH_MM_SS));
        return communityNoticeMapper.insertCommunityNotice(communityNotice);
    }

    /**
     * 修改档案
     * 
     * @param communityNotice 档案
     * @return 结果
     */
    @Override
    public int updateCommunityNotice(CommunityNotice communityNotice)
    {
        return communityNoticeMapper.updateCommunityNotice(communityNotice);
    }

    /**
     * 批量删除档案
     * 
     * @param ids 需要删除的档案主键
     * @return 结果
     */
    @Override
    public int deleteCommunityNoticeByIds(Long[] ids)
    {
        return communityNoticeMapper.deleteCommunityNoticeByIds(ids);
    }

    /**
     * 删除档案信息
     * 
     * @param id 档案主键
     * @return 结果
     */
    @Override
    public int deleteCommunityNoticeById(Long id)
    {
        return communityNoticeMapper.deleteCommunityNoticeById(id);
    }

    @Override
    public List<CommunityNotice> queryAll() {

        return communityNoticeMapper.queryAll();
    }
}
